﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Wicture.QPZS.EPC.Models
{
    public class MaintainGroupDto
    {
        public string maintainCode { get; set; }
        public string maintainName { get; set; }
        public string totalPrice { get; set; }
        public List<MaintainPartDtoSub> SubItems { get; set; }
    }
    public class MaintainPartDto
    {
        /// <summary>
        /// 保养项目名称
        /// </summary>
        public string maintainName { get; set; }
        /// <summary>
        /// 保养项目编码
        /// </summary>
        public string maintainCode { get; set; }
        /// <summary>
        /// 总价格
        /// </summary>
        public string totalPrice { get; set; }
        /// <summary>
        /// 配件标准Code
        /// </summary>
        public string standardCode { get; set; }
        /// <summary>
        /// 配件标准名
        /// </summary>
        public string standardName { get; set; }
        /// <summary>
        /// 用量
        /// </summary>
        public string usage { get; set; }

        /// <summary>
        /// 原厂零件名
        /// </summary>
        public string partName { get; set; }

        /// <summary>
        /// 原厂OE号
        /// </summary>
        public string partCode { get; set; }
        /// <summary>
        /// 是否选中
        /// </summary>
        public bool isSelected { get; set; }

        public string quantity { get; set; }

        public MaintainPartDto(MaintainPartEntity entity)
        {
            this.usage = entity.usage;
            this.maintainCode = entity.maintainCode;
            this.maintainName = entity.maintainName;
            this.standardCode = entity.standardCode;
            this.standardName = entity.standardName;
            this.totalPrice = entity.totalPrice;
            this.partCode = entity.partCode;
            this.partName = entity.partName;
            this.quantity = entity.quantity;
        } 
    }
    public class MaintainPartDtoSub
    {
        /// <summary>
        /// 配件标准Code
        /// </summary>
        public string standardCode { get; set; }
        /// <summary>
        /// 配件标准名
        /// </summary>
        public string standardName { get; set; }
        /// <summary>
        /// 用量
        /// </summary>
        public string usage { get; set; }
        /// <summary>
        /// 是否选中
        /// </summary>
        public bool isSelected { get; set; }
        /// <summary>
        /// 原厂零件名
        /// </summary>
        public string partName { get; set; }
        /// <summary>
        /// 原厂OE号
        /// </summary>
        public string partCode { get; set; }

        public string quantity { get; set; }

        public MaintainPartDtoSub(MaintainPartDto dto)
        {
            this.standardName = dto.standardName;
            this.standardCode = dto.standardCode;
            this.usage = dto.usage;
            this.isSelected = dto.isSelected;
            this.partName = dto.partName;
            this.partCode = dto.partCode;
            this.quantity = dto.quantity;
        }
    }
    public class MaintainPartEntity
    {
        /// <summary>
        /// 保养项目名称
        /// </summary>
        public string maintainName { get; set; }
        /// <summary>
        /// 保养项目编码
        /// </summary>
        public string maintainCode { get; set; }
        /// <summary>
        /// 总价格
        /// </summary>
        public string totalPrice { get; set; }
        /// <summary>
        /// 配件标准Code
        /// </summary>
        public string standardCode { get; set; }
        /// <summary>
        /// 配件标准名
        /// </summary>
        public string standardName { get; set; }
        /// <summary>
        /// 用量
        /// </summary>
        public string usage { get; set; }
        /// <summary>
        /// 首次保养时间
        /// </summary>
        public int firstMaintain { get; set; }
        /// <summary>
        /// 周期保养时间
        /// </summary>
        public int circleMaintain { get; set; }

        public int circleMaintainMonth { get; set; }

        public string partCode { get; set; } = "-";
        public string partName { get; set; } = "-";
        public string quantity { get; set; } = "-";
    }

    public class VinPartResult
    {
        public string statusCode { get; set; }
        public string errorMessage { get; set; }
        public List<VinPart> data { get; set; }
    }

    public class VinPart
    {
        public string partCode { get; set; }
        public string partName { get; set; }
        public string quantity { get; set; }
    }
}
